package response

import "mallgo/internal/resources/product/model"

type ProductCatalogResponse struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	ParentID *int64 `gorm:"column:parent_id"`
	SortNum  *int64 `gorm:"column:sort_num"`
	Status   int64  `json:"status"`
}

func ConvertProductCatalogResponse(productCatalog *model.ProductCatalog) ProductCatalogResponse {
	return ProductCatalogResponse{
		ID:       productCatalog.ID,
		Name:     *productCatalog.Name,
		ParentID: productCatalog.ParentID,
		SortNum:  productCatalog.SortNum,
		Status:   productCatalog.Status,
	}
}
